<template>
    <div class="header">
    <span class="iconfont header_left">&#xe681;</span><span class="header_title">北京理工大学国防科技园2号楼10层</span><span class="iconfont header_right">&#xe8c0;</span>
  </div>

<div class="home_search">
   <Search placeholder='山姆会员商店优惠商品'></Search>
</div>

<div class="banner">
  <img src="http://www.dell-lee.com/imgs/vue3/banner.jpg"/>
</div>

<div class="nav">
  <div class="nav_item" v-for="item in headerList" :key="item.name">
    <img :src="item.imgUrl" alt="">
    <p>{{item.name}}</p>
  </div>
</div>
</template>

<style lang="scss" scoped>
@import '../../assets/style/public.scss';
 .header{
  box-sizing: $box-sizing;
  width: 100%;
  font-size: .16rem;
  padding: .08rem .193rem 0 .181rem;
  line-height: .22rem;
  position: relative;
  &_left.iconfont{
    font-size: .18rem;
    margin-right: .07rem;
    vertical-align: top;
  }
  &_right.iconfont{
    font-size: .24rem;
    position: absolute;
    right: .193rem;
  }
  &_title{
    display: inline-block;
     @include text-ellipsis(2.9rem);
  }
}
.home_search{
  width: 90%;
  height: .32rem;
  margin: .16rem .18rem .12rem .18rem;
}
.banner{
  height: 0;
  overflow: hidden;
  padding: 0 .18rem 25.4% .18rem;
  img{
    width: 100%;
  }
}
.nav{
  display:flex;
  flex-wrap: wrap;
  padding-top: .08rem;
  border-bottom: 10px solid $border-bottom;
  &_item{
    width: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    img{
      width: .4rem;
      height: .4rem;
    }
  }
}
</style>

<script>
import Search from '../../components/search/search.vue'
export default {
  name: 'Header',
  components: {
    Search
  },
  setup () {
    const headerList = [
      { imgUrl: 'http://www.dell-lee.com/imgs/vue3/超市.png', name: '超市便利' },
      { imgUrl: 'http://www.dell-lee.com/imgs/vue3/菜市场.png', name: '菜市场' },
      { imgUrl: 'http://www.dell-lee.com/imgs/vue3/水果店.png', name: '水果店' },
      { imgUrl: 'http://www.dell-lee.com/imgs/vue3/鲜花.png', name: '鲜花绿植' },
      { imgUrl: 'http://www.dell-lee.com/imgs/vue3/医药健康.png', name: '医药健康' },
      { imgUrl: 'http://www.dell-lee.com/imgs/vue3/家居.png', name: '家居时尚' },
      { imgUrl: 'http://www.dell-lee.com/imgs/vue3/蛋糕.png', name: '烘培蛋糕' },
      { imgUrl: 'http://www.dell-lee.com/imgs/vue3/签到.png', name: '签到' },
      { imgUrl: 'http://www.dell-lee.com/imgs/vue3/大牌免运.png', name: '大牌免运' },
      { imgUrl: 'http://www.dell-lee.com/imgs/vue3/红包.png', name: '红包套餐' }
    ]
    return { headerList }
  }
}
</script>
